const express = require('express');
const asyncHandler = require('express-async-handler');
const reportController = require('../controllers/basic.controller')
const router = express.Router();
module.exports = router;

//获取报告列表

//根据报告类型获取报告内容

router.post('/getReportByDuration', asyncHandler(getReportByDuration));

router.post('/getReportList',asyncHandler(getReportList));
router.post('/getReportById',asyncHandler(getReportById));

async function getReportByDuration(req, res) {
    let result = await reportController.getReprtsWithTypeByDuration(req.body);
    res.json(result);
}


async function getReportList(req,res){
    let result = await reportController.getReportList(req.body)
    res.json(result);
}

async function getReportById(req,res){
    let result = await reportController.getReportById(req.body)
    res.json(result)
}